
import { Table } from 'element-ui';


export default {
  name: 'ElTable',
  extends: Table, // 指定继承组件
  props: {
    /**是否强制更新 */
    forceUpdate: {
      type: Boolean,
      default: true,
    },
    fitHeader: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      autoWidth: 0,
    };
  },
  watch: {
    data: function (newVal, oldVal) {
      if (this.forceUpdate) this.$Bus.$emit("tableDataChanged", newVal);
    }
  },
  beforeDestroy() {
    if (this.forceUpdate) this.$Bus.$off('tableDataChanged')
  }

};
